/** COPYRIGHT(C) 2008. Loc Phan. All Rights Reserved.
Java class that create a dice
@author Loc Phan
@version 1.01 2008-11-26
*/

package edu.sjsu.cs.phan.hw6;

import java.util.Random;

public class Die implements Measurable
{
   /**Constructs a dice
    * 
    * @param i Number of sides
    */
   public Die(int i)
   {
      number = i;
   }
   /**Cast the dice
    * 
    * @return Number on the dice
    */
   public int cast()
   {
      Random gen = new Random();
      result = 1 + gen.nextInt(number);
      return result;
   }
   /**
    * Returns the number on 
    * a casted dice
    */
   public double getMeasure()
   {
      return result;
   }
   private int number;
   private int result;

}
